#!perl -T

use Test::More tests => 7;

use Data::PrintUtils qw(:ALL);

like (formatHash( {One => "1", Two => "2", Three => "3"}), qr/((One|Two|Three) => (1|2|3)\s*){3}/, "formatHash - basic hash");
like (formatHash( {One => "1", Two => "2", Three => "3"},{PRIMARY_KEY_ORDER => [qw/One Two Three/]}), qr/One => 1\s*Two => 2\s*Three => 3\s*/, "formatHash - basic hash with key ordering");
like (formatHash( {One => "1", Two => undef, Three => "3"},{PRIMARY_KEY_ORDER => [qw/One Two Three/]}), qr/One => 1\s*Two => undef\s*Three => 3\s*/, "formatHash - basic hash - undef value");
like (formatHash( {One => "1", Three => "3"},{PRIMARY_KEY_ORDER => [qw/One Two Three/]}), qr/One => 1\s*Two => notExist\s*Three => 3\s*/, "formatHash - basic hash - key does not exist");
like (formatHash( 
		{One => "1", Two => [1,2,3], Three => "3"},
		{PRIMARY_KEY_ORDER => [qw/One Two Three/]}), 
		qr/\s*One => 1\s*Two => \(1, 2, 3\)\s*Three => 3\s*/, 
		"formatHash - deep hash - list included");
like (formatHash( 
		{One => "1", Two => {Un => "1", Deux => "2",Trois => "3"}, Three => "3"},
		{PRIMARY_KEY_ORDER => [qw/One Two Three/]}), 
		qr/\s*One => 1\s*Two => \{(\s*(Un|Deux|Trois) => (1|2|3),?\s*){3}\}\s*Three => 3\s*/, 
		"formatHash - deep hash - hash included");
like (formatHash( 
		{One => "1", Two => {Un => "1", Deux => "2",Trois => "3"}, Three => "3"},
		{PRIMARY_KEY_ORDER => [qw/One Two Three/],SECONDARY_KEY_ORDER => [qw/Un Deux Trois/] }), 
		qr/\s*One => 1\s*Two => \{Un => 1, Deux => 2, Trois => 3\}\s*Three => 3\s*/, 
		"formatHash - deep hash - hash included with Secondary key ordering");